<?php
class CommonFunction extends CActiveRecord{
    public static function random_number_barcode(){

    }
    public static function read_barcode(){

    }
    public static function generate_ticket_code()
    {

    }
    public static function generate_organizer_order_code(){

    }
    public static function multiexplode ($delimiters,$string) {

        $ready = str_replace($delimiters, $delimiters[0], $string);
        $launch = explode($delimiters[0], $ready);
        return  $launch;
    }
    public static function gethtml_email_barcode($event_send_email,$book){
        $html = '<div style="border:1px solid #ddd;border-radius:5px;"><table style="width:600px;margin:0 auto" >
                <tr><td style="text-align:center" colspan=2>
            <img src="'.Yii::app()->getBaseUrl(true).'/barcode.php?code=123456789123">
              </td></tr>'
            . '<tr><td style="text-align:left;padding:20px;color:black">'
            . '<b style="color:#1474b4">'.$event_send_email->translate[0]['main_title'].'</b>
                    <br/><span style="color:#fc8825">'.$event_send_email->translate[0]['sub_title'].'</span><br/>
                    <br/>'.date_format(new DateTime($event_send_email['start_time']), 'h:i A') . ',' . date_format(new DateTime($event_send_email['start_date']), 'd - m , Y').'
                    <br/>'.$event_send_email->translate[0]['location'].'
                    <br/>Loại vé: vip
                    <br/>Giá tiền: '. number_format($book->total_price) . ' VNĐ'.'
                    <br/>Số ghế: A1'.'
                    </td>
                    <td style="text-align:left;padding:20px">
                    <b style="color:#1474b4">'.$event_send_email->translate[1]['main_title'].'</b>
                    <br/><span style="color:#fc8825">'.$event_send_email->translate[1]['sub_title'].'</span><br/>
                    <br/>'.date_format(new DateTime($event_send_email['start_time']), 'h:i A') . ',' . date_format(new DateTime($event_send_email['start_date']), 'd - m , Y').'
                    <br/>'.$event_send_email->translate[1]['location'].'
                    <br/>Loại vé: vip
                    <br/>Giá tiền: '. number_format($book->total_price) . ' VNĐ'.'
                    <br/>Số ghế: A1'.'
                    </td></tr>
                    </table>
                    </div>';
        return $html;
    }
}